<?php 
class Product_image_model extends Model {
	
	var $tbl_name = 'product_image';
	
	function Product_image_model() {
		parent::Model();
	}
	
	function addProduct_image($ary_info=array()) {
		$this->db->insert($this->tbl_name, $ary_info);
		
		return $this->db->insert_id();
	} 
	
	function deleteProduct_image($id) {
		$this->db->delete($this->tbl_name,array('product_id'=>$id));
	}
	
	function getProduct_image($ary_where) {
		$this->db->select('uri_path');
		$this->db->where($ary_where);
		
		$query = $this->db->get($this->tbl_name);
		if ($query->num_rows()>0) {
			return $query->result_array(); 
		}
	}
}